package com.miao.hong.fang.admin.service;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;

import org.apache.struts.upload.FormFile;

import com.miao.hong.fang.admin.BackupFileTO;
import com.miao.hong.fang.admin.ContactInfoTO;
import com.miao.hong.fang.course.CourseTO;
import com.miao.hong.fang.teacher.TeacherTO;
import com.miao.hong.fang.util.pagination.ListAndCount;

public interface AdminService {

	public void addCourse(CourseTO courseTO);
	
	public ListAndCount searchCourse(String courseTitle, String coursePeriod, String courseStartTimeAsStr, String courseEndTimeAsStr,
			String coursePrice, String courseCity, String courseCategory, String courseTeacher, String isHotCourse, 
			String isRecommendCourse, String isPublicCourse);
	
	CourseTO getCourseDetail(String courseId);

	void updateCourse(CourseTO courseTO);
	
	void deleteCourse(String courseId, String version);
	
	List getTeacherByCategory(String category);	
	
	boolean validateTeacherName(String name);
	
	String addTeacher(TeacherTO teacherTO);
	
	ListAndCount searchTeacher(String teacherName, String teacherDesc, String teachMajor); 
	
	void deleteTeacher(String teacherId, String version);
	
	TeacherTO getTeacherDetail(String teacherId);
	
	ListAndCount getCoursesByTeacher(String teacherId);
	
	void updateTeacher(TeacherTO teacherTO);
	
	void addCourseCategory(String courseCategory);
	
	void updateCourseCategory(String oldValue, String newValue);
	
	void deleteCourseCategory(String categoryName);
	
	List getAllCourse();
	
	void saveTeacherImageToDB(String id, FormFile file) throws Exception;
	BackupFileTO getBackupFile(String id);
	void deleteBackupFile(String id);
	
	void addContactInfo(String aboutUs, String contantPerson, String phone, String email, String qq, String msn);
	ContactInfoTO getContactInfo();
	void updateContactInfo(ContactInfoTO to);
	
	List getAllImages();
	
	byte[] getImage(String id);
}
